<?php
$taskName=$_POST['task_name']??'';
$taskContent=$_POST['task_Content']??'';

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "insert into Task(TaskName,TaskContent)
values ('{$taskName}','{$taskContent}')";
$result = $db->exec($sql);
if ($result){
    echo "增加成功，前往<a href='list.php'>列表页</a>查看";
}else{
    echo "添加失败";
}
